﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Info.Master" AutoEventWireup="true" CodeBehind="Print.aspx.cs" Inherits="BBPA.Admin.Sys.Orders.Print" %>

<%@ MasterType VirtualPath="~/Info.Master" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style>
        .infoTable, .minWidth { min-width: 400px; }
    </style>
    <script>
        $(function () {
            //  $("body").jqprint({ operaSupport: true });
        })
    </script>
    <style>
        .SellWay { position:absolute;margin-top:20px;}
        .text-right { position:relative;}
        .text-right .SellWay {right:10px; }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cph_main" runat="server">
    <asp:Repeater ID="rp_Orders" runat="server" OnItemDataBound="rp_Orders_ItemDataBound">
        <ItemTemplate>
            <div style="<%#Container.ItemIndex>0?"page-break-before: always": "" %>">
                <table class="infoTable">
                    <tr>
                        <td>孕婴店：<%#Eval("StoreName") %></td>
                        <td>订单号：<%#Eval("Number") %> </td>
                        <td class="text-right">采购日期：<%# ((DateTime)Eval("ExpectBuyDate")).ToShortDateString() %> </td>
                    </tr>
                </table>



                <asp:Repeater ID="rp_Goods" runat="server" OnItemDataBound="rp_Goods_ItemDataBound">
                    <HeaderTemplate>
                        <table class="infoTable haveBorder">
                            <thead>
                                <tr>
                                    <th rowspan="2" colspan="2">商品</th>
                                    <th id="th_Expect" runat="server" colspan="3" style="border-left: 1px dashed #e5e5e5">预计采购</th>
                                    <th id="th_Actual" runat="server" colspan="3" style="border-left: 1px dashed #e5e5e5">实际采购</th>
                                    <th></th>
                                </tr>
                                <tr>

                                    <th id="th_ExpectPrice" runat="server" style="border-left: 1px dashed #e5e5e5">单价</th>
                                    <th id="th_ExpectAmount" runat="server">数量</th>
                                    <th id="th_ExpectPriceSum" runat="server" style="text-align: right;">小计</th>

                                    <th id="th_ActualPrice" runat="server" style="border-left: 1px dashed #e5e5e5">单价</th>
                                    <th id="th_ActualAmount" runat="server">数量</th>
                                    <th id="th_ActualPriceSum" runat="server" style="text-align: right;">小计</th>

                                    <th></th>
                                </tr>

                            </thead>
                    </HeaderTemplate>
                    <ItemTemplate>
            <tr id="tr_SupplierName" runat="server"><td colspan="9" style="padding-bottom:0;padding-top:24px;border-left:1px solid #fff;border-right:1px solid #fff;">
                供货商：<b><%#Eval("SupplierShortName") %></b> 
                <i class="fa fa-mobile <%#DataTypePlus.requestString(Eval("Mobile"))!=""?"":"hide" %>" style="margin-left:10px;"> <%# Eval("Mobile") %></i>
                 <i class="fa fa-phone <%#DataTypePlus.requestString(Eval("Tel"))!=""?"":"hide" %>" style="margin-left:10px;"> <%#Eval("Tel") %></i>
                 <%#(bool)Eval("IsLatePay")?" 后付款":"" %><%#(bool)Eval("IsDelivery")?" 送货":"" %></td>
            </tr>
            <tr data-key-id="<%#Eval("GoodsID") %>" data-row-title="<%#Eval("Name") %>" style="background-color:#fdfdfd;">
                            <td width="80">
                                <div style="width: 80px"></div>
                                <img src="<%#Eval("PicURL") %>" />
                            </td>
                            <td>
                                <div style="line-height: initial;"><%#Eval("Number") %> <%#Eval("BrandName") %> <%#Eval("Name") %> <%#Eval("Code") %></div>
                                
                    <div style="line-height: initial;" class="alert <%#DataTypePlus.requestString( Eval("Description"))==""?"hide":"" %>"><%#Eval("Description") %></div>
                            </td>

                            <td id="td_ExpectAmount" runat="server" style="text-align: center; border-left: 1px dashed #e5e5e5;">
                                <%#StringPlus.showCoin( Eval("ExpectPrice")) %>
                            </td>
                            <td id="td_ExpectPrice" runat="server" style="text-align: center;">
                    <div class="label label-info SellWay <%#(int)Eval("ExpectBuyGiftNumber")==0?"hide":"" %>">赠<%#Eval("ExpectBuyGiftNumber") %></div>
                                <%#Eval("ExpectAmount") %>
                            </td>
                            <td id="td_ExpectPriceSum" runat="server" itemsum="1" class="text-error  text-right" >
                                <%#StringPlus.showCoin( DataTypePlus.requestDecimal(Eval("ExpectPay")) ) %>
                                <div class="label label-info SellWay <%#(int)Eval("ExpectDiscount")==100?"hide":"" %>"><%#DataTypePlus.requestDecimal( Eval("ExpectDiscount"))/10 %>折</div>
                            </td>

                            <td id="td_ActualAmount" runat="server" style="text-align: center; border-left: 1px dashed #e5e5e5;">
                                 <%#StringPlus.showCoin( Eval("ActualBuyPrice")) %>
                            </td>
                            <td id="td_ActualPrice" runat="server" style="text-align: center; ">
                    <div class="label label-info SellWay <%#(int)Eval("ActualBuyGiftNumber")==0?"hide":"" %>">赠<%#Eval("ActualBuyGiftNumber") %></div>
                               <%#Eval("ActualAmount") %>
                            </td>
                            
                            <td id="td_ActualPriceSum" runat="server" itemsum="1" class="text-error text-right">
                                <%#StringPlus.showCoin( Eval("ActualPay")) %>
                                <div class="label label-info SellWay <%#(int)Eval("ActualBuyDiscount")==100?"hide":"" %>"><%#DataTypePlus.requestDecimal( Eval("ActualBuyDiscount"))/10 %>折</div>

                            </td>

                            <td><i class="fa fa-check fa-2x <%#(bool)Eval("HasBuy")?"":"hide" %>"></i></td>
                        </tr>
                        <tr id="tr_xiaoji" runat="server">
                <td colspan="5" style="padding-top:0;padding-bottom:24px;border-left:1px solid #fff;border-right:1px solid #fff;border-bottom:1px solid #fff; text-align:right;">
                本供货商 预计合计：<asp:Label ID="lb_Supplier_ExpectBuyPriceSum" runat="server" CssClass="text-error"></asp:Label></td>
                <td id="td_Supplier_ExpectBuyPriceSum" runat="server" colspan="4" style="padding-top:0;padding-bottom:24px;border-left:1px solid #fff;border-right:1px solid #fff;border-bottom:1px solid #fff; text-align:right;">
                本供货商 实际合计：<asp:Label ID="lb_Supplier_ActualBuyPriceSum" runat="server" CssClass="text-error"></asp:Label>
            </td></tr>
                    </ItemTemplate>
                    <FooterTemplate>
                        <tr class="">
                            <td colspan="2"></td>
                            <td colspan="3" id="td_Orders_ExpcetPriceSum" runat="server" style="border-left: 1px dashed #e5e5e5">
                                <h4 style="text-align: right;" class="text-error nowrap">合计：<asp:Label ID="lb_ExpectPay" runat="server" Text=""></asp:Label></h4>
                            </td>
                            <td colspan="3" id="td_Orders_ActualPrice" runat="server" style="border-left: 1px dashed #e5e5e5">
                                <h4 style="text-align: right;" class="text-error nowrap">合计：<asp:Label ID="lb_ActualPay" runat="server" Text=""></asp:Label></h4>
                            </td>
                            <td></td>
                        </tr>
                        </table>
                    </FooterTemplate>
                </asp:Repeater>
            </div>
        </ItemTemplate>
    </asp:Repeater>
</asp:Content>


